#include "dialoghomenavigation.h"
#include "ui_dialoghomenavigation.h"
#include "dialogdailpad.h"
#include "dialogloginselect.h"
#include "dialogsmarthome.h"
#include "dialogsecuritynavigation.h"
#include "dialoginformation.h"
#include "dialogdigitalphotoframe.h"

/**/
DialogHomeNavigation::DialogHomeNavigation(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogHomeNavigation)
{
    ui->setupUi(this);

#if INDOOREMBED
    setWindowFlags(Qt::FramelessWindowHint);//隐藏窗口标题栏
#endif

    //取消按键虚线框
    ui->btn_mainmenu_0->setFocusPolicy(Qt::NoFocus);
    ui->btn_mainmenu_1->setFocusPolicy(Qt::NoFocus);
    ui->btn_mainmenu_2->setFocusPolicy(Qt::NoFocus);
    ui->btn_mainmenu_3->setFocusPolicy(Qt::NoFocus);
    ui->btn_mainmenu_4->setFocusPolicy(Qt::NoFocus);

    ui->btn_mainmenu_0->setText("");
    ui->btn_mainmenu_1->setText("");
    ui->btn_mainmenu_2->setText("");
    ui->btn_mainmenu_3->setText("");
    ui->btn_mainmenu_4->setText("");

    ui->pbn_state_network->setFocusPolicy(Qt::NoFocus);
    ui->pbn_state_security->setFocusPolicy(Qt::NoFocus);
    ui->pbn_state_external_storage->setFocusPolicy(Qt::NoFocus);
    ui->pbn_state_information->setFocusPolicy(Qt::NoFocus);

    ui->pbn_state_network->setText("");
    ui->pbn_state_security->setText("");
    ui->pbn_state_external_storage->setText("");
    ui->pbn_state_information->setText("");
}

DialogHomeNavigation::~DialogHomeNavigation()
{
    delete ui;
}

void DialogHomeNavigation::paintEvent(QPaintEvent *event)
{
    printf("DialogHomeNavigation paintEvent \n");
#if 0
    QPainter painter(this);
    painter.drawPixmap(0, 0, 800, 480, QPixmap("./images/main.jpg"));
#endif
}

void DialogHomeNavigation::on_btn_mainmenu_2_clicked()
{
    DialogDailPad *dialog = new DialogDailPad(this);
    dialog->setModal(true);
    //dialog->show();
    dialog->exec();
    delete dialog;
}

void DialogHomeNavigation::on_btn_mainmenu_4_clicked()
{
    DialogSmartHome *dialog = new DialogSmartHome(this);
    dialog->setModal(true);
    //dialog->show();
    dialog->exec();
    delete dialog;
}

void DialogHomeNavigation::on_pbn_state_network_clicked()
{
    DialogLoginSelect *dialog = new DialogLoginSelect(this);
    dialog->setModal(true);
    //dialog->show();
    dialog->exec();
    delete dialog;
}

void DialogHomeNavigation::on_btn_mainmenu_0_clicked()
{
    DialogSecurityNavigation *dialog = new DialogSecurityNavigation(this);
    dialog->setModal(true);
    //dialog->show();
    dialog->exec();
    delete dialog;
}

void DialogHomeNavigation::on_btn_mainmenu_3_clicked()
{
    DialogInformation *dialog = new DialogInformation(this);
    dialog->setModal(true);
    //dialog->show();
    dialog->exec();
    delete dialog;
}

void DialogHomeNavigation::on_btn_mainmenu_1_clicked()
{
    DialogDigitalPhotoFrame *dialog = new DialogDigitalPhotoFrame(this);
    dialog->setModal(true);
    //dialog->show();
    dialog->exec();
    delete dialog;
}
